package dao

import (
	"gitee.com/shuwenhe/shuwen-go/login/model"
	"gitee.com/shuwenhe/shuwen-go/login/utils"
)

func CheckUsernameAndPassword(username, password string) (*model.User, error) {
	sql := "select id,username,password from users where username = ? and password = ?"
	row := utils.Db.QueryRow(sql, username, password)
	user := &model.User{}
	row.Scan(&user.ID, &user.Username, &user.Password)
	return user, nil
}
